package prototype;

public class PrototypeTestMain {
    public static void main(String[] args) {
        // 创建原型对象
        Prototype prototype = new ConcretePrototype(10);
        // 克隆对象
        Prototype clonedPrototype = prototype.clone();
        // 修改克隆对象的值
        ((ConcretePrototype) clonedPrototype).setValue(20);

        // 输出原型对象和克隆对象的值
        System.out.println("Original Prototype Value: " + ((ConcretePrototype) prototype).getValue());
        System.out.println("Cloned Prototype Value: " + ((ConcretePrototype) clonedPrototype).getValue());

    }
}